package cc.admin.modules.sys.service.impl;

import cc.admin.common.sys.vo.LoginUser;
import cc.admin.modules.sys.service.IMyDutyService;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import java.util.Map;


@Service
public class MyDutyServiceImpl implements IMyDutyService {

    @Autowired
    private JdbcTemplate jdbcTemplate;




    @Override
    public Map<String, Object> selectMyDuty() {
        LoginUser user=(LoginUser) SecurityUtils.getSubject().getPrincipal();
        Map<String, Object>  map= jdbcTemplate.queryForMap("select * from "+user.getTenantId()+"_sys_my_duty where post=? and tenant_id=? limit 1 ", user.getPost(),user.getTenantId());
        return map;
    }
}
